#[cfg(test)]
mod tests {
    use salvo::http::mime;
    use salvo::Service;
    use salvo::test::{ResponseExt, TestClient};
    use tokio::test;
    use crate::router;

    #[test]
    async fn test() {
        let service = Service::new(router());

        let mut resp = TestClient::get(format!("http://127.0.0.1:14300"))
            .send(&service).await;
        let option = resp.content_type();
        assert_eq!(Some(mime::TEXT_HTML_UTF_8), option);
        let content = resp.take_string().await.unwrap();
        assert!(content.contains(r"<body>
1111sdfadf
</body>"));

        let content1 = TestClient::get(format!("http://127.0.0.1:14300/index.html"))
            .send(&service).await.take_string().await.unwrap();
        assert_eq!(content1, content);

        let content = TestClient::get(format!("http://127.0.0.1:14300/test.html"))
            .send(&service).await.take_string().await.unwrap();
        assert!(content.contains(r"<body>
test page
</body>"));
    }
}